<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>编辑用户</title>
<%    
String path = request.getContextPath();    
// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量    
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";    
// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。    
%>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="<%=basePath%>bootstrap-3.3.5/css/bootstrap.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="<%=basePath%>jquery-1.11.3/jquery.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="<%=basePath%>bootstrap-3.3.5/js/bootstrap.js"></script>
<script type="text/javascript">
</script>
</head>
<body>
<div class="container">
<h2 class="bg-info">添加用户</h2>
<form action="<%=basePath %>user/editUser.html" method="post">
	  <input name="id" value="${user.id }" type="hidden"/>	
	  <div class="form-group">
	    <label for="exampleInputEmail1">Username</label>
	    <input type="text" class="form-control" id="exampleInputEmail1" placeholder="Username" name="username" value="${user.username }">
	  </div>
	  <div class="form-group">
	    <label for="exampleInputEmail1">Email</label>
	    <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email" name="email" value="${user.email }">
	  </div>
	  <div class="form-group">
	    <label for="exampleInputPassword1">Password</label>
	    <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password" name="password" value="${user.password }">
	  </div>
	  <div class="form-group">
	    <label for="exampleInputEmail1">Yours Hobby</label>
	    <input type="text" class="form-control" id="exampleInputEmail1" placeholder="hobby" name="hobby" value="${user.hobby }">
	  </div>	
	  <button type="submit" class="btn btn-default">Submit</button>
	  <button type="submit" class="btn btn-default">Reset</button>
</form>
<c:if test="${flag == 1 }">
	<h4 class="bg-success">编辑用户成功！</h4>
</c:if>
<br/>
<a href="<%=basePath%>user/showUsers.html" >返回人员列表</a>
</div>
</body>
</html>
